package com.aya.simple.spring;

import org.springframework.context.ApplicationListener;
import org.springframework.stereotype.Component;

@Component
public class TemperatureObservable implements ApplicationListener<WeatherSubject> {

    @Override
    public void onApplicationEvent(WeatherSubject weatherSubject) {
        System.out.println("温度:"+weatherSubject.getTemperature());
    }
}
